import { get } from "../mock";

import request from "@/utils/request";
import { AxiosPromise } from "axios";
import {
  evaluateComForms,
  evaluateComQuery,
  evaluateComPageVO,
  evaluateComPageResult,
} from "./type";

/**
 * 获取分页数据
 *
 * @param queryParams
 */
export function getevaluateComPage(
  queryParams?: evaluateComQuery
): AxiosPromise<evaluateComPageResult> {
  return request({
    url: "/api/work/workPage",
    method: "get",
    params: queryParams,
  });
}

/**
 * 获取ID集合
 *
 * @param queryParams
 */
export function getevaluateComMenuIds(
  queryParams?: evaluateComQuery
): AxiosPromise<string[]> {
  return request({
    url: "/api/work/find",
    method: "get",
    params: queryParams,
  });
}

// /**
//  * 评测
//  *
//  * @param queryParams
//  */
// export function getevaluate(
//   queryParams?: evaluateComQuery
// ): AxiosPromise<string[]> {
//   return request({
//     url: "/api/work/sendQuestion",
//     method: "post",
//     params: queryParams,
//   });
// }

/**
 * 评测
 *
 * @param data
 */
export function getevaluate(data: evaluateComForms) {
  return request({
    url: "/api/work/sendQuestion",
    method: "post",
    data: data,
  });
}

// /**
//  * 更新
//  *
//  * @param id
//  * @param data
//  */
// export function updateevaluateCom(data: evaluateComForms) {
//   return request({
//     url: "/api/work/update",
//     method: "put",
//     data: data,
//   });
// }

/**
 * 获取用户ID集合
 *
 * @param queryParams
 */
export function getUserIds(ids: string): AxiosPromise<number[]> {
  return request({
    url: "/api/sys/user/info",
    method: "get",
  });
}
